import React, { useState } from 'react'
import './Login.less'
export default function Index(props) {
    const [Btndata] = useState(["登录", "注册"])
    function Goto(index){
        if(index === 0){
            props.history.push('/register')
        }else{
            props.history.push('/sigIn')
        }
    }
    return (
        <div className='Loginbox'>
            <div className='btnBox'>
                {
                    Btndata.map((item, index) => {
                        return <button key={index} onClick={()=>{
                            Goto(index)
                        }}>{item}</button>
                    })
                }
            </div>
        </div>
    )
}
